<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:proov='http://wlm.com.mx/SAI/proveedor'>
  <xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  <xsl:decimal-format name="dollar"
decimal-separator="." grouping-separator=","/>
  <xsl:template match="//proov:Proveedor"><link href="/XMLCss/cotizacionPantalla.css" rel="stylesheet" type="text/css" />
  
    <div id="ContenedorProveedor2">     
      <div style="display:block; width:1000px;">
        <div id="NombreCliente"> Proveedor No. <xsl:value-of select="proov:id"/>  - <xsl:value-of select="@NombreComercial"/> - <xsl:value-of select="@RazonSocial"/></div>
        <div>
        <div style="float:left;width:333px;">
          <table id="meta">
            <tbody>
              <tr>
                <td class="meta-head">Proveedor #</td>
                <td><xsl:value-of select="proov:id"/></td>
              </tr>
              <tr>
                <td class="meta-head">R. Social</td>
                <td>
                    <xsl:value-of select="@RazonSocial"/>
                    
                  </td>
              </tr>
              <tr>
                <td class="meta-head">N. Comercial</td>
                <td><xsl:value-of select="@NombreComercial"/></td>
              </tr>
              <tr>
                <td class="meta-head">R. Legal</td>
                <td><div class="due"><xsl:value-of select="@RepresentanteLegal"/></div></td>
              </tr>
              <tr>
                <td class="meta-head">RFC</td>
                <td><div class="due"><xsl:value-of select="@RFC"/></div></td>
              </tr>
              <tr>
                <td class="meta-head">L. Transporte</td>
                <td><div class="due"><xsl:value-of select="@LineaTransporte"/></div></td>
              </tr>
            </tbody>
          </table>
        </div>
        <div style="float:left; width:333px;">
          <table id="meta">
            <tbody>
              <tr>
                <td class="meta-head">Telefono</td>
                <td><xsl:value-of select="@Telefono"/></td>
              </tr>
              <tr>
                <td class="meta-head">Telefono 2</td>
                <td><xsl:value-of select="@Telefono2"/></td>
              </tr>
              <tr>
                <td class="meta-head">Telefono 3</td>
                <td><xsl:value-of select="@Telefono3"/></td>
              </tr>
              <tr>
                <td class="meta-head">FAX</td>
                <td><div class="due"><xsl:value-of select="@FAX"/></div></td>
              </tr>
              <tr>
                <td class="meta-head">Email</td>
                <td><div class="due"><xsl:value-of select="@Email"/></div></td>
              </tr>
              <tr>
                <td class="meta-head">WebSite</td>
                <td><div class="due"><xsl:value-of select="@WebSite"/></div></td>
              </tr>
            </tbody>
          </table>
        </div>
        <div style="float:left; width:333px;">
          <table id="meta">
            <tbody>
              <tr>
                <td class="meta-head">Categoria</td>
                <td><xsl:value-of select="@NombreCategoria"/></td>
              </tr>
              <tr>
                <td class="meta-head">L. de Precios</td>
                <td><xsl:value-of select="@idListaPrecios"/></td>
              </tr>
              <tr>
                <td class="meta-head">Vendedor</td>
                <td><xsl:value-of select="@NombreVendedor"/></td>
              </tr>
              <tr>
                <td class="meta-head">C. Pago</td>
                <td><xsl:value-of select="@NombreCondicionesPago"/></td>
              </tr>
              <tr>
                <td class="meta-head">Saldo Actual</td>
                <td><div class="due">$<xsl:value-of select="format-number(@SaldoActual, '#,##0.00','dollar')"/></div></td>
              </tr>
              <tr>
                <td class="meta-head">L. de Credito</td>
                <td><div class="due">$<xsl:value-of select="format-number(@LimiteCredito, '#,##0.00','dollar')"/></div></td>
              </tr>
            </tbody>
          </table>
        </div>
        </div>
        <div>
        <xsl:apply-templates select="//proov:DireccionFacturacion"/>
        
        <xsl:apply-templates select="//proov:DireccionEnvio"/>
        <div style="width:330px; float:left;">
    <div id="addressheader" style="width:325px;">Ultimos Movimientos:</div>
    <table id="meta">
            <tbody>
              <tr>
                <td class="meta-head">U. Compra</td>
                <td>$<xsl:value-of select="format-number(@UltimaCompra, '#,##0.00','dollar')"/></td>
              </tr>
              <tr>
                <td class="meta-head">F. U. Compra</td>
                <td><xsl:call-template name="FormatDate">
                    <xsl:with-param name="DateTime" select="@FechaUltimaCompra"/>
                    
                  </xsl:call-template></td>
              </tr>
              <tr>
                <td class="meta-head">Ultimo Pago</td>
                <td>$<xsl:value-of select="format-number(@UltimoPago, '#,##0.00','dollar')"/></td>
              </tr>
              <tr>
                <td class="meta-head">f. U. Pago</td>
                <td><xsl:call-template name="FormatDate">
                    <xsl:with-param name="DateTime" select="@FechaUltimoPago"/>
                    
                  </xsl:call-template></td>
              </tr>
              <tr>
                <td class="meta-head">Ultima Cot.</td>
                <td>$<xsl:value-of select="format-number(@UltimaCotizacion, '#,##0.00','dollar')"/></td>
              </tr>
              <tr>
                <td class="meta-head">F. U. Cot.</td>
                <td><xsl:call-template name="FormatDate">
                    <xsl:with-param name="DateTime" select="@FechaUltimaCotizacion"/>
                    
                  </xsl:call-template></td>
              </tr>
              </tbody>
              </table>
              </div>
        </div>
      </div>
      
      
    </div>

  </xsl:template>
  
  <xsl:template match="//proov:DireccionFacturacion">

          
    <div style="width:330px; float:left;">
    <div id="addressheader" style="width:325px;">Direccion de Facturacion:</div>
    <table id="meta">
            <tbody>
              <tr>
                <td class="meta-head">Calle</td>
                <td><xsl:value-of select="@Calle"/><xsl:value-of select="@NumeroExterior"/>-<xsl:value-of select="@NumeroInterior"/></td>
              </tr>
              <tr>
                <td class="meta-head">Colonia</td>
                <td><xsl:value-of select="@Colonia"/></td>
              </tr>
              <tr>
                <td class="meta-head">Ciudad</td>
                <td><xsl:value-of select="@Ciudad"/></td>
              </tr>
              <tr>
                <td class="meta-head">Municipio</td>
                <td><xsl:value-of select="@Municipio"/></td>
              </tr>
              <tr>
                <td class="meta-head">Estado</td>
                <td><xsl:value-of select="@Estado"/></td>
              </tr>
              <tr>
                <td class="meta-head">C.P.</td>
                <td><xsl:value-of select="@CP"/></td>
              </tr>
              </tbody>
              </table>
              </div>
  </xsl:template>
  <xsl:template match="//proov:DireccionEnvio">
    <div style="width:330px; float:left;" ><div id="addressheader" style="width:325px;">Direccion de Fisica:</div>
    <table id="meta">
            <tbody>
              <tr>
                <td class="meta-head">Calle</td>
                <td><xsl:value-of select="@Calle"/><xsl:value-of select="@NumeroExterior"/>-<xsl:value-of select="@NumeroInterior"/></td>
              </tr>
              <tr>
                <td class="meta-head">Colonia</td>
                <td><xsl:value-of select="@Colonia"/></td>
              </tr>
              <tr>
                <td class="meta-head">Ciudad</td>
                <td><xsl:value-of select="@Ciudad"/></td>
              </tr>
              <tr>
                <td class="meta-head">Municipio</td>
                <td><xsl:value-of select="@Municipio"/></td>
              </tr>
              <tr>
                <td class="meta-head">Estado</td>
                <td><xsl:value-of select="@Estado"/></td>
              </tr>
              <tr>
                <td class="meta-head">C.P.</td>
                <td><xsl:value-of select="@CP"/></td>
              </tr>
              </tbody>
              </table>
              </div>
  </xsl:template>
  <xsl:template name="FormatDate">
    <xsl:param name="DateTime" />
    <xsl:variable name="year" select="substring($DateTime,1,4)" />
    <xsl:variable name="month-temp" select="substring-after($DateTime,'-')" />
    <xsl:variable name="month" select="substring-before($month-temp,'-')" />
    <xsl:variable name="day-temp" select="substring-after($month-temp,'-')" />
    <xsl:variable name="day" select="substring($day-temp,1,2)" />
    <xsl:variable name="time" select="substring-after($DateTime,'T')" />
    <xsl:variable name="hh" select="substring($time,1,2)" />
    <xsl:variable name="mm" select="substring($time,4,2)" />
    <xsl:variable name="ss" select="substring($time,7,2)" />
    
    <!-- Long DATE FORMAT -->
    
    <xsl:value-of select="$day"/><xsl:value-of select="' de '"/><!--January -->
    <!--January 12 -->
    <xsl:choose>
      <xsl:when test="$month = '1' or $month= '01'">
        Enero
      </xsl:when>
      <xsl:when test="$month = '2' or $month= '02'">
        Febrero
      </xsl:when>
      <xsl:when test="$month= '3' or $month= '03'">
        Marzo
      </xsl:when>
      <xsl:when test="$month= '4' or $month= '04'">
        Abril
      </xsl:when>
      <xsl:when test="$month= '5' or $month= '05'">
        Mayo
      </xsl:when>
      <xsl:when test="$month= '6' or $month= '06'">
        Junio
      </xsl:when>
      <xsl:when test="$month= '7' or $month= '07'">
        Julio
      </xsl:when>
      <xsl:when test="$month= '8' or $month= '08'">
        Augosto
      </xsl:when>
      <xsl:when test="$month= '9' or $month= '09'">
        Septiembre
      </xsl:when>
      <xsl:when test="$month= '10'">
        Octubre
      </xsl:when>
      <xsl:when test="$month= '11'">
        Noviembre
      </xsl:when>
      <xsl:when test="$month= '12'">
        Diciembre
      </xsl:when>
    </xsl:choose>
    <xsl:value-of select="' de'"/><!--January 12,-->
    <xsl:value-of select="' '"/><!--January 12, -->
    <xsl:value-of select="$year"/><!--January 12, 2001-->
    <!--
    <xsl:value-of select="' a las '"/><xsl:value-of select="$hh"/><xsl:value-of select="':'"/><xsl:value-of select="$mm"/><xsl:value-of select="':'"/><xsl:value-of select="$ss"/><xsl:value-of select="' (GMT) '"/>-->
    <!-- END: Long DATE FORMAT -->
    
  </xsl:template>
</xsl:stylesheet>